import axios from 'axios';

let base = '';


export const start = () => {
  return axios.request({
      method: 'get',
      url: 'http://192.168.28.110:9000/api/kucun/kucun_info'
  })
}
export const Outinfo = () => {
  return axios.request({
      method: 'get',
      url: 'http://192.168.28.110:9000/api/kucun/out_info'
  })
}
export const Ininfo = () => {
  return axios.request({
      method: 'get',
      url: 'http://192.168.28.110:9000/api/kucun/in_info',
  })
}
export const Addinfo = params => {
  return axios.request({
      method: 'post',
      url: 'http://192.168.28.110:9000/api/kucun/in_info',
      data: params
  })
}

export const Updtininfo = (params,id) => {
  return axios.request({
      method: 'put',
      url: 'http://192.168.28.110:9000/api/kucun/in_info/'+id,
      data: params
  })
}

export const Addoutinfo = params => {
  return axios.request({
      method: 'post',
      url: 'http://192.168.28.110:9000/api/kucun/out_info',
      data: params
  })
}

export const Rmoutinfo = (id) => {
  return axios.request({
      method: 'delete',
      url: 'http://192.168.28.110:9000/api/kucun/out_info/'+id,
  })
}
export const Updtoutinfo = (params,id) => {
  return axios.request({
      method: 'put',
      url: 'http://192.168.28.110:9000/api/kucun/out_info/'+id,
      data: params
  })
}

export const outinfoChart = () => {
  return axios.request({
      method: 'get',
      url: 'http://192.168.28.110:9000/api/kucun/out_info_charts',

  })
}

export const AllOutinfo = () => {
  return axios.request({
      method: 'get',
      url: 'http://192.168.28.110:9000/api/kucun/outall_info',
  })
}






















export const requestLogin = params => {
  return axios.post(`${base}/login`, params).then(res => res.data);
};

export const getUserListPage = params => {
  return axios.get(`${base}/user/listpage`, {
    params: params
  });
};

export const removeUser = params => {
  return axios.get(`${base}/user/remove`, {
    params: params
  });
};

export const batchRemoveUser = params => {
  return axios.get(`${base}/user/batchremove`, {
    params: params
  });
};

export const editUser = params => {
  return axios.get(`${base}/user/edit`, {
    params: params
  });
};

export const addUser = params => {
  return axios.get(`${base}/user/add`, {
    params: params
  });
};
